package com.pmcc.core.vo;

import com.pmcc.core.entity.Organization;

import java.util.List;

public class OrgVo extends Organization {
    private List<OrgVo> children;
    private String title;
    private String key;


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public List<OrgVo> getChildren() {
        return children;
    }

    public void setChildren(List<OrgVo> children) {
        this.children = children;
    }

    /**
     * Organization -->VO
     *
     * @return
     */
    public static OrgVo getOrgVo(Organization organization){
        OrgVo orgVo=new OrgVo();
        if(organization!=null){
//            orgVo.setTitle(organization.getcName());
            orgVo.setId(organization.getId());
            orgVo.setCode(organization.getCode());
            orgVo.setName(organization.getName());
//            orgVo.seteName(organization.geteName());
            orgVo.setOrgNo(organization.getOrgNo());
//            orgVo.setShortName(organization.getShortName());
//            orgVo.setDescription(organization.getDescription());
            orgVo.setParentId(organization.getParentId());
            orgVo.setParentCode(organization.getParentCode());
            orgVo.setParentName(organization.getParentName());
            orgVo.setLevel(organization.getLevel());
//            orgVo.setOrgLevel(organization.getOrgLevel());
//            orgVo.setSortNo(organization.getSortNo());
//            orgVo.setStatus(organization.getStatus());
//            orgVo.setSystemCode(organization.getSystemCode());
//            orgVo.setCreateName(organization.getCreateName());
            orgVo.setCreateId(organization.getCreateId());
            orgVo.setCreateTime(organization.getCreateTime());
//            orgVo.setCreateUnitName(organization.getCreateUnitName());
//            orgVo.setCreateUnitId(organization.getCreateUnitId());
            orgVo.setRemark(organization.getRemark());
            orgVo.setKey(organization.getCode());
//            orgVo.setDelFlag(organization.getDelFlag());
//            orgVo.setRegistrationNumber(organization.getRegistrationNumber());
//            orgVo.setOrgType(organization.getOrgType());
        }
        return orgVo;
    }

}
